<template>
	<view class="padd" v-loading.fullscreen.lock="fullscreenLoading">
		<view class="mg">
			工作室名称：
			<el-input
		  placeholder="请输入工作室名称"
		  v-model.trim="logoname.studioName"
		  clearable>
		</el-input>
		</view>
		<view class="mg">
			联系电话：<el-input
		  placeholder="请输入联系电话"
		  v-model.trim="logoname.studioTel"
		  clearable>
		</el-input>
		</view>
		<el-row :gutter="24">
		  <!-- <el-col :span="6"><div class="grid-content bg-purple"></div></el-col> -->
		  <el-col :span="6" :offset="18">
				<el-button type="primary" class="fl" @click="sub">提 交</el-button>
			</el-col>
		</el-row>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				logoname:{
					logoSrc: "",
					studioName: "",
					studioTel:''
				},
				fullscreenLoading: false
			}
		},
		onShow() {
			this.fullscreenLoading = true
			uniCloud.callFunction({
				name:'logoname',
				data:{sign:1}//标示：查询用，必填
			}).then((res)=>{
				console.log('res',res)
				if (res.result.data.length>0) {
					this.logoname = res.result.data[0]
					this.fullscreenLoading = false
				} else{
					this.fullscreenLoading = false
					this.$message.error('数据初始化错误，刷新啊！')
				}
			})
		},
		methods: {
			
			sub(){
				
				if (this.logoname.studioName) {
					this.fullscreenLoading = true;
					console.log(this.logoname.studioName)
					uniCloud.callFunction({
						name:'logoname',
						data:Object.assign(this.logoname,{sign:2}),
						
					}).then((res)=>{
						this.fullscreenLoading = false;
						console.log('res1',res)
					})
				} else{
					this.$message.error('想找麻烦？给我输入个名称！')
				}
			}
		}
	}
</script>

<style>
	

</style>
